<template>
  <div id="left">
    <aside class="main-sidebar">
      <section class="sidebar">
        <ul class="sidebar-menu">
          <!-- 门诊 -->
          <li class="treeview">
            <a>
              <i class="fa fa-share" />
              <span>门诊</span>
              <i class="fa fa-angle-left pull-right" />
            </a>
            <ul class="treeview-menu">
              <li>
                <a>
                  <i class="fa fa-circle-o" />
                  挂号
                  <i class="fa fa-angle-left pull-right" />
                </a>
                <ul class="treeview-menu">
                  <li>
                    <router-link :to="{ name: 'RegistrationDetials' }">
                      <i class="fa fa-circle-o" />
                      挂号详情
                    </router-link>
                  </li>
                  <li>
                    <router-link :to="{ name: 'PatientsOur' }">
                      <i class="fa fa-circle-o" />
                      本校病人
                    </router-link>
                  </li>
                  <li>
                    <router-link :to="{ name: 'PatientsOther' }">
                      <i class="fa fa-circle-o" />
                      外校病人
                    </router-link>
                  </li>
                  <li>
                    <router-link :to="{ name: 'Tongji' }">
                      <i class="fa fa-circle-o" />
                      挂号统计
                    </router-link>
                  </li>
                </ul>
              </li>

              <li>
                <a>
                  <i class="fa fa-circle-o" />
                  处方管理
                  <i class="fa fa-angle-left pull-right" />
                </a>
                <ul class="treeview-menu">
                  <!-- <li>
                    <router-link :to="{ name: 'test' }">
                      <i class="fa fa-circle-o" />
                      开处方
                    </router-link>
                  </li>
                  <li>
                    <router-link :to="{ name: 'stu' }">
                      <i class="fa fa-circle-o" />
                      测试用
                    </router-link>
                  </li> -->
                  <li>
                    <router-link :to="{ name: 'countdata' }">
                      <i class="fa fa-circle-o" />
                      处方管理
                    </router-link>
                  </li>
                </ul>
              </li>

              <li>
                <a>
                  <i class="fa fa-circle-o" />
                  医疗卡
                  <i class="fa fa-angle-left pull-right" />
                </a>
                <ul class="treeview-menu">
                  <li>
                    <router-link :to="{ name: 'Medical' }">
                      <i class="fa fa-circle-o" />
                      医疗卡信息
                    </router-link>
                  </li>
                  <li>
                    <router-link :to="{ name: 'Top-up' }">
                      <i class="fa fa-circle-o" />
                      充值
                    </router-link>
                  </li>
                  <li>
                    <router-link :to="{ name: 'Top-table' }">
                      <i class="fa fa-circle-o" />
                      充值账单
                    </router-link>
                  </li>
                  <li>
                    <router-link :to="{ name: 'Bill' }">
                      <i class="fa fa-circle-o" />
                      代扣计费
                    </router-link>
                  </li>
                </ul>
              </li>

              <li>
                <a>
                  <i class="fa fa-circle-o" />
                  其他信息
                  <i class="fa fa-angle-left pull-right" />
                </a>
                <ul class="treeview-menu">
                  <li>
                    <router-link :to="{ name: 'Menzhenkemu' }">
                      <i class="fa fa-circle-o" />
                      门诊科目
                    </router-link>
                  </li>
                  <li>
                    <router-link :to="{ name: 'Doctorviews' }">
                      <i class="fa fa-circle-o" />
                      医生信息
                    </router-link>
                  </li>
                  <li>
                    <router-link :to="{ name: 'Jianchaitems' }">
                      <i class="fa fa-circle-o" />
                      检查项目
                    </router-link>
                  </li>
                  <li>
                    <router-link :to="{ name: 'Shujutongji' }">
                      <i class="fa fa-circle-o" />
                      数据统计
                    </router-link>
                  </li>
                  <li>
                    <router-link :to="{ name: 'Searchziliao' }">
                      <i class="fa fa-circle-o"></i>
                      资料查询
                    </router-link>
                  </li>
                </ul>
              </li>
            </ul>
          </li>
          <!-- 人事管理 -->
          <li class="treeview">
            <a>
              <i class="fa fa-share" />
              <span>人事管理</span>
              <i class="fa fa-angle-left pull-right" />
            </a>
            <ul class="treeview-menu">
              <li>
                <router-link :to="{ name: 'Renshiguanli' }">
                  <i class="fa fa-circle-o" />
                  人事基本资料
                </router-link>
              </li>
              <li>
                <router-link :to="{ name: 'Xiangxixingxi' }">
                  <i class="fa fa-circle-o" />
                  详细信息
                </router-link>
              </li>
              <li>
                <router-link :to="{ name: 'jiashu' }">
                  <i class="fa fa-circle-o" />
                  主要社会关系资料
                </router-link>
              </li>
              <li>
                <router-link :to="{ name: 'jianli' }">
                  <i class="fa fa-circle-o" />
                  个人简历
                </router-link>
              </li>
              <li>
                <router-link :to="{ name: 'Family' }">
                  <i class="fa fa-circle-o" />
                  资料统计
                </router-link>
              </li>
            </ul>
          </li>
          <!-- 病案管理 -->
          <li class="treeview">
            <a>
              <i class="fa fa-share" />
              <span>病案管理</span>
              <i class="fa fa-angle-left pull-right" />
            </a>
            <ul class="treeview-menu">
              <li>
                <router-link :to="{ name: 'bingan' }">
                  <i class="fa fa-circle-o" />
                  病案
                </router-link>
              </li>
              <li>
                <router-link :to="{ name: 'bingli' }">
                  <i class="fa fa-circle-o" />
                  病例
                </router-link>
              </li>
              <li>
                <router-link :to="{ name: 'guojijibing' }">
                  <i class="fa fa-circle-o" />
                  国际疫情
                </router-link>
              </li>
              <li>
                <router-link :to="{ name: 'shoushu' }">
                  <i class="fa fa-circle-o" />
                  手术详情
                </router-link>
              </li>
              <li>
                <router-link :to="{ name: 'Bingantongji' }">
                  <i class="fa fa-circle-o" />
                  病案统计
                </router-link>
              </li>
            </ul>
          </li>

          <li class="treeview">
            <a>
              <i class="fa fa-share" />
              <span>工费医疗</span>
              <i class="fa fa-angle-left pull-right" />
            </a>
            <ul class="treeview-menu">
              <li>
                <router-link :to="{ name: 'Levelcode' }">
                  <i class="fa fa-circle-o" />
                  级别码
                </router-link>
              </li>
              <li>
                <router-link :to="{ name: 'Medicalmoney' }">
                  <i class="fa fa-circle-o" />
                  报销单
                </router-link>
              </li>
            </ul>
          </li>
        </ul>
      </section>
    </aside>
  </div>
</template>

<script>
import sidebar from '@/assets/js/sidebar-menu';
import { mapActions } from 'vuex';
import { getStorage, setStorage, removeStorage } from '../../assets/js/storage';

export default {
  watch: {
    $route: 'updataToken',
  },
  mounted() {
    sidebar.sidebar();
    $.sidebarMenu($('.sidebar-menu'));
  },
  methods: {
    ...mapActions(['tongyong']),
    updataToken() {
      this['tongyong']({
        name: 'UPDATATOKEN',
      }).then(resp => {
        setStorage('token', resp.data.data);
      });
    },
  },
};
</script>

<style src="../../assets/css/sidebar-menu.css" scoped></style>
<style src="../../assets/css/font-awesome.min.css" scoped></style>
<style src="../../assets/css/bootstrap.min.css" scoped></style>
<style scoped>
#left {
  width: 100%;
  height: 100%;
  background: #2a3f54;
  overflow: hidden;
}
#left:hover {
  overflow-x: hidden;
  overflow-y: auto;
}
</style>
